home *** CD-ROM | disk | FTP | other *** search
/ Sounds Terrific 1 / Sounds Terrific CD (1994)(Weird Science)(Disc 2 of 2)[!][Amiga-PC].iso / modules / l / lfew420.mod < prev    next >
Encoding:
Text File  |  1994-08-04  |  9.0 KB  |  264 lines

  1. LASTFEW.420 (Colors your last few callers) New Version
  2. Rambo #1 @8856
  3. Wed Dec 04 01:37:22 1991
  4.                                LASTFEW.420
  5.  
  6.                         Last Few Callers Mod for V4.20
  7.                                      
  8.                         Original author: Doc #1 @4350
  9.                             The BoardWalker BBS
  10.                               (413) 549-4133
  11.                           Amherst, Massachusetts
  12.                               August 6, 1989
  13.  
  14.  
  15.                            Modified for WWIV V4.20
  16.                              By: Rambo #1 @8856
  17.                                Rambo-Scan BBS
  18.                                (818) 566-7912
  19.                              Burbank, California
  20.                               December 3rd 1991
  21.  
  22.  
  23. NOTE: This MOD has been changed to work for only WWIV 4.20, and if you would
  24. like to use this on an earlier version, you will have to look around for
  25. the original MOD (LASTFEW.MOD).  I may have the original source sitting
  26. around, but I really suggest that you upgrad to WWIV 4.20.
  27.  
  28.  
  29. ===========================> What Does It Do? <============================
  30.  
  31.  
  32.      Adding this modification to your WWIV source code will format your
  33. "Last Few Callers" listing (and your Log of the Day file) so it doesn't
  34. appear so jumbled.  The modification prints the call number, user name and
  35. number, time of call (in standard time - not military time), date, baud
  36. rate, and number of times on today in justified columns, and in color.  A
  37. sample of the output is shown below:
  38.  
  39.  
  40. 559964: Eno #20                  211:31 pm  308/05/89  72400 - 1
  41. 559974: Marty Karlin #132        212:20 am  308/06/89  72400 - 1
  42. 559984: Pat Buttons #4           212:28 am  308/06/89  71200 - 1
  43. 559994: Pat Buttons #4           21:16 am   308/06/89  71200 - 2
  44. 560004: Benny Hill #8            21:37 am   308/06/89  72400 - 1
  45. 560014: Rambo #1                 23:40 am   308/06/89  79600 - 1
  46. 560024: Jim Connor #35           23:52 am   308/06/89  72400 - 1
  47.  
  48.  
  49. ========================> How Long will it take? <========================
  50.  
  51.         If you are using a program such as Q-Edit, you can cut and paste
  52. this MOD in about 5 minutes or less depending on your ability.
  53.  
  54. ==========================================================================
  55.  
  56.      As it is written, the colors are set as follows (the WWIV numbers in
  57. parenthesis refer to the default colors of WWIV, as set in D:efaults from
  58. the Main Menu.  If you've modified these settings, the colors of the list
  59. will change accordingly).  Please feel free to change them to what ever
  60. you would like, but the way I have it set up looks real nice, give it a
  61. try first.
  62.  
  63.      
  64.      Call number:  Green                  (WWIV color 5)
  65.      User name:    White on Blue          (WWIV color 4)
  66.      Time:         High Intensity Yellow  (WWIV color 2)
  67.      Date:         High Intensity Magenta (WWIV color 3)
  68.      Baud rate
  69.      & times on:   High Intensity Blue    (WWIV color 7)
  70.  
  71.  
  72. ==========================> How Do I Install It? <========================
  73.  
  74. _________________________________ Step 1 _________________________________
  75.  
  76.  
  77. Add the following prototypes to the end of FCNS.H, then save the file:
  78.  
  79. char *get_time(char *hhmm);
  80. char *copy(char *sstring, int position, int numchars, char *dstring);
  81. void insert(char *obstr, char *trgstr, int position);
  82.  
  83.  
  84. _________________________________ Step 2 _________________________________
  85.  
  86.  
  87. Add the following #include statements to LILO.C:
  88.  
  89. #include <math.h>
  90. #include <dos.h>
  91.  
  92. _________________________________ Step 3 _________________________________
  93.  
  94.  
  95. While still in LILO.C, search for void logon(), and change the variable
  96. declaration from:
  97.  
  98. /* Old Code */
  99. void logon()
  100. {
  101.   char s[255],s1[81],s2[81],*ss;  /* This is the line you change */
  102.   int i,i1,f;
  103.   long len,pos;
  104. /* Old Code */
  105.  
  106. to read:
  107.  
  108. char s[255],s1[81],s2[81],s3[81],s4[81],hhmm[10],*ss;
  109.  
  110. _________________________________ Step 4 _________________________________
  111.  
  112.  
  113. Scroll down a bit, looking for the following segment of code:
  114.  
  115.   if ((actsl!=255) || (incom)) {
  116.     sl1(0,"");
  117.     sl1(0,s);
  118.     sl1(1,"");
  119.  
  120. Replace the section under sl1(1,"") with the following code:
  121.  
  122.    sl1(1,"");                          /* existing line */
  123.  
  124.     /* Begin Modified Code */
  125.  
  126.     sprintf(s,"\003%c",'5');
  127.     ltoa(status.callernum1,s3,10);
  128.     strcat(s,s3);
  129.     strcat(s,": ");
  130.     strcpy(s3,s4);
  131.     sprintf(s3,"\003%c%-25s",'4',nam(&thisuser,usernum));
  132.     strcat(s,s3);
  133.     strcpy(s3,s4);
  134.     sprintf(s3,"\003%c%-8s  ",'2',get_time(hhmm));
  135.     strcat(s,s3);
  136.     strcpy(s3,s4);
  137.     sprintf(s3,"\003%c%s  ",'3',date());
  138.     strcat(s,s3);
  139.     strcpy(s3,s4);
  140.     sprintf(s3,"\003%c%s - %d",'7',curspeed,thisuser.ontoday);
  141.     strcat(s,s3);
  142.     strcpy(s3,s4);
  143.  
  144.     /* End Modified Code */
  145.  
  146.     sprintf(s1,"%sUSER.LOG",syscfg.gfilesdir);  /* existing line */
  147.  
  148. _________________________________ NOTES _________________________________
  149.  
  150.   1.  There is a segment of code that is very similar to the one you are
  151. replacing just above the correct segment.  Be sure you are replacing the
  152. correct series of strcat lines; the set you want is *below* the line that
  153. reads "pl("Last few callers: ")".
  154.  
  155.   2.  The colors and formatting of the list are specified in the above code
  156. segment.  As it is written, the code allows 25 spaces for the caller's name
  157. (%-25s), filling the unused space with blanks.  The colors are specified in
  158. the sprintf lines; they are the numbers surrounded by single quotes (e.g.
  159. '5'), and correspond to the default WWIV colors.
  160.  
  161. _________________________________ Step 5 _________________________________
  162.  
  163.  
  164. Go to the end of LILO.C, and add the following functions, then save the
  165. file:
  166.  
  167.  
  168. char *get_time(char *hhmm)
  169. {
  170.     char tstr[10], tstr1[10];
  171.     struct time timeblk;
  172.  
  173.     gettime(&timeblk);
  174.     sprintf(hhmm, "%02d%02d", timeblk.ti_hour, timeblk.ti_min);
  175.     insert(":", hhmm, 3);
  176.     if (strcmp(copy(hhmm, 1, 2, tstr), "12") > 0)
  177.      sprintf(hhmm, "%d%s pm", atoi(copy(hhmm, 1, 2, tstr)) - 12,
  178.           copy(hhmm, 3, 3, tstr1));
  179.     else
  180.     {
  181.      if (strcmp(copy(hhmm, 1, 2, tstr), "01") < 0)
  182.          sprintf(hhmm, "12%s am", copy(hhmm, 3, 3, tstr));
  183.      else
  184.      {
  185.          if (strcmp(copy(hhmm, 1, 2, tstr), "10") < 0)
  186.           sprintf(hhmm, "%s am", copy(hhmm, 2, 4, tstr));
  187.          else
  188.           sprintf(hhmm, "%s am", copy(hhmm, 1, 5, tstr));
  189.      }
  190.     }
  191.     return (hhmm);
  192. }
  193.  
  194. char *copy(char *sstring, int position, int numchars, char *dstring)
  195. {
  196.     int c;
  197.  
  198.     if (position <= strlen(sstring))
  199.     {
  200.      for (c = 0, position--, numchars--; ((sstring[position]) && (c <=
  201.           numchars));
  202.           position++, c++)
  203.          dstring[c] = sstring[position];
  204.      dstring[c] = 0;
  205.     } else
  206.      dstring[0] = 0;
  207.  
  208.     return (dstring);
  209. }
  210.  
  211. void insert(char *obstr, char *trgstr, int position)
  212. {
  213.     int oblen, trglen;
  214.  
  215.     position--;
  216.     trglen = strlen(trgstr);
  217.     if (position <= trglen)
  218.     {
  219.      oblen = strlen(obstr);
  220.      movmem(trgstr + position, trgstr + oblen + position,
  221.             trglen - position + 1);
  222.      movmem(obstr, trgstr + position, oblen);
  223.     } else
  224.      strcat(trgstr, obstr);
  225. }
  226. _________________________________ Step 6 _________________________________
  227.  
  228.  
  229. Recompile the whole BBS (press F9 while in the Turbo C environment) or type
  230. MAKE from the DOS prompt, and you're done.  You've modified FCNS.H, so a
  231. complete recompilation is necessary.
  232.  
  233.  
  234. ________________________________ Comments ________________________________
  235.  
  236.      No warranty, guarantee or liability for the use of this code is
  237. implied, expressed, or assumed by the author.  Implementation of this code
  238. is strictly a voluntary decision on your part, and its use implies full
  239. consent and agreement by you with the above conditions.  This code
  240. contained in this file is released to the public domain, and may be
  241. modified to suit particular needs.  The WWIV source code and program is
  242. Copyright (c) 1988 by Wayne Bell.
  243.  
  244.      My thanks to Pete Runyan (#1 @4351) for beta testing the code and its
  245. implementation instructions.  Special thanks to Wayne Bell for creating
  246. WWIV, for his continuing efforts at improving an already great BBS program,
  247. and for releasing the source code to registered users.
  248.  
  249. If you have any problems, questions, or comments, you may contact me at the
  250. BoardWalker BBS as #1@4350, or call at (413) 549-4133.
  251.  
  252. _____________________________ Final Comments _____________________________
  253.  
  254. (From Rambo)
  255.  
  256.         Thanks to all that made this MOD possible, I didn't change a whole
  257. lot from the oritinal MOD.  If you computer explodes, don't blame me,
  258. I didn't do it.  I have this MOD running on my BBS, and I just re-tested it
  259. on Virgin Source Code and it just compiled without any errors.
  260. If you have any problems, please feel free to contact me.
  261.  
  262. Rambo #1 @8856 (818) 566-7912 3/12/24/9600 Buad Compucom SpeedModem Combo.
  263. Home of the largest Anti-Virus Transfer Section in the United States.
  264.